<?php

/**
 * Created by PhpStorm.
 * Script Name: ImageMessageHandler.php
 * Create: 2020/6/8 下午11:12
 * Description: 特殊消息类型处理器
 * Author: fudaoji<fdj@kuryun.cn>
 */

namespace plugin\wechat\app\platform\handler\mp;

use plugin\wechat\app\model\MpRule;
use plugin\wechat\app\model\MpSpecial;

class SpecialMessageHandler extends MessageHandler
{
    /**
     * @var MpSpecial
     */
    private $specialM;
    /**
     * @var MpRule
     */
    private $ruleM;

    /**
     * 初始化
     * @author fudaoji<fdj@kuryun.cn>
     */
    public function __construct() {
        parent::__construct();
        $this->specialM = new MpSpecial();
        $this->ruleM = new MpRule();
    }

    /**
     * 处理器
     * @param null $payload
     * @return mixed
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     * @author fudaoji<fdj@kuryun.cn>
     */
    public function handle($payload = null) {
        parent::handle($payload);

        $res = $this->replySpecial($payload['MsgType'], $payload);
        if($res){
            return $res;
        }
    }
}